<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="class1" id="id1">div1</div>
    <div>div2</div>
    <script>
        console.log(document.getElementById('id1'));
        console.log(document.getElementsByClassName('class1')[0]);
        console.log(document.getElementsByTagName('div')[0]);
        console.log(document.querySelector('#id1'));
        console.log(document.querySelector('.class1'));
        console.log(document.querySelector('div'));
        console.log(document.querySelectorAll('div'));

        var div=document.getElementsByClassName('class1')[0]
        var span=document.createElement('span')
        var li=document.createElement('li')
        var del=document.createElement('del')
        var h1=document.createElement('h1')

        div.appendChild(span)
        div.appendChild(li)

        div.insertBefore(del,span)

        div.replaceChild(h1,li)

        div.setAttribute('hello','hi')
        console.log(div.getAttribute('hello'));

        console.log(div.innerText);
        console.log(div.innerHTML);
    </script>
</body>
</html>